import threading, time

class MyThread(threading.Thread):
    def __init__(self, num):
        threading.Thread.__init__(self)  # 必须写
        self.num = num
    # 定义线程运行函数
    def run(self):
        print("正在运行:%s"%self.num)
        time.sleep(3)
# 创建线程类实例
t1 = MyThread(1)
t2 = MyThread(2)
t1.start()
t2.start()

